<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="../../">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Converters &mdash; SystemDS 3.2.0-dev documentation</title>
      <link rel="stylesheet" type="text/css" href="../../static/pygments.css?v=80d5e7a1" />
      <link rel="stylesheet" type="text/css" href="../../static/css/theme.css?v=19f00094" />

  
  <!--[if lt IE 9]>
    <script src="../../static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script src="../../static/jquery.js?v=5d32c60e"></script>
        <script src="../../static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="../../static/documentation_options.js?v=596fb6d1"></script>
        <script src="../../static/doctools.js?v=888ff710"></script>
        <script src="../../static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../../static/js/theme.js"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Helpers" href="helpers.html" />
    <link rel="prev" title="Script" href="../script_building/script.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="../../index.html" class="icon icon-home">
            SystemDS
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Getting Started:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/install.html">Install SystemDS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../getting_started/simple_examples.html">QuickStart</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../guide/federated.html">Federated Environment</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guide/algorithms_basics.html">Built-in Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../guide/python_end_to_end_tut.html">Python end-to-end tutorial</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../context/systemds_context.html">SystemDSContext</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/algorithms.html">Algorithms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/matrix.html">Matrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/frame.html">Frame</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/list.html">List</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/scalar.html">Scalar</a></li>
<li class="toctree-l1"><a class="reference internal" href="../operator/node/source.html">Source</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Internals API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../operator/operation_node.html">Operation Node</a></li>
<li class="toctree-l1"><a class="reference internal" href="../script_building/dag.html">Dag</a></li>
<li class="toctree-l1"><a class="reference internal" href="../script_building/script.html">Script</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Converters</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#systemds.utils.converters.frame_block_to_pandas"><code class="docutils literal notranslate"><span class="pre">frame_block_to_pandas()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#systemds.utils.converters.matrix_block_to_numpy"><code class="docutils literal notranslate"><span class="pre">matrix_block_to_numpy()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#systemds.utils.converters.numpy_to_matrix_block"><code class="docutils literal notranslate"><span class="pre">numpy_to_matrix_block()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#systemds.utils.converters.pandas_to_frame_block"><code class="docutils literal notranslate"><span class="pre">pandas_to_frame_block()</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="helpers.html">Helpers</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">SystemDS</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Converters</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../sources/api/utils/converters.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="converters">
<h1>Converters<a class="headerlink" href="#converters" title="Link to this heading"></a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>OPS! For internal use!</p>
</div>
<dl class="py function" id="module-systemds.utils.converters">
<dt class="sig sig-object py" id="systemds.utils.converters.frame_block_to_pandas">
<span class="sig-prename descclassname"><span class="pre">systemds.utils.converters.</span></span><span class="sig-name descname"><span class="pre">frame_block_to_pandas</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sds</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fb</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">JavaObject</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#systemds.utils.converters.frame_block_to_pandas" title="Link to this definition"></a></dt>
<dd><p>Converts a FrameBlock object in the JVM to a pandas dataframe.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sds</strong> – The current systemds context.</p></li>
<li><p><strong>fb</strong> – A pointer to the JVM’s FrameBlock object.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="systemds.utils.converters.matrix_block_to_numpy">
<span class="sig-prename descclassname"><span class="pre">systemds.utils.converters.</span></span><span class="sig-name descname"><span class="pre">matrix_block_to_numpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">jvm</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">JVMView</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mb</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">JavaObject</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#systemds.utils.converters.matrix_block_to_numpy" title="Link to this definition"></a></dt>
<dd><p>Converts a MatrixBlock object in the JVM to a numpy array.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>jvm</strong> – The current JVM instance running systemds.</p></li>
<li><p><strong>mb</strong> – A pointer to the JVM’s MatrixBlock object.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="systemds.utils.converters.numpy_to_matrix_block">
<span class="sig-prename descclassname"><span class="pre">systemds.utils.converters.</span></span><span class="sig-name descname"><span class="pre">numpy_to_matrix_block</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sds</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">np_arr</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">array</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#systemds.utils.converters.numpy_to_matrix_block" title="Link to this definition"></a></dt>
<dd><p>Converts a given numpy array, to internal matrix block representation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sds</strong> – The current systemds context.</p></li>
<li><p><strong>np_arr</strong> – the numpy array to convert to matrixblock.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="systemds.utils.converters.pandas_to_frame_block">
<span class="sig-prename descclassname"><span class="pre">systemds.utils.converters.</span></span><span class="sig-name descname"><span class="pre">pandas_to_frame_block</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">sds</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pd_df</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">DataFrame</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#systemds.utils.converters.pandas_to_frame_block" title="Link to this definition"></a></dt>
<dd><p>Converts a given numpy array, to internal matrix block representation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sds</strong> – The current systemds context.</p></li>
<li><p><strong>np_arr</strong> – the numpy array to convert to matrixblock.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../script_building/script.html" class="btn btn-neutral float-left" title="Script" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="helpers.html" class="btn btn-neutral float-right" title="Helpers" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2023, Apache SystemDS.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>